import Vue from 'vue'
import Toast from './toast.vue'

const ToastBox = Vue.extend(Toast)

Toast.install = function (data) {
  let instance = new ToastBox({
    data
  }).$mount()

  document.body.appendChild(instance.$el)

  Vue.nextTick(() => {
    instance.showFlag = true
  })
}

export default Toast
